import AdminImage from "./component/AdminImage/index.tsx";
import { useConfig, ConfigProvider } from "./hook/D8dConfigProvider.tsx";
import Manager, {
  type TableColumnConfig,
  type ManageApiConfig,
} from "./component/Manager/index.tsx";
import { MainLayout } from "./component/MainLayout/index.tsx";
import dayjs from "dayjs";
import lodash from "lodash";
import * as antd from "antd";
import datetimeFormat from "./utils/datetimeFormat.ts";
import { DesignConfigLayout } from "./component/DesignConfigLayout/index.tsx";
import { DesignLayout } from "./component/DesignLayout/index.tsx";
import ModalForm from "./component/ModalForm/index.tsx";
import DetailView from "./component/DetailView/index.tsx";
import AdminTreeSelect from "./component/AdminTreeSelect/index.tsx";
import AdminSelect from "./component/AdminSelect/index.tsx";
import { getSysConfigLabel, matchPath, extractParamsFromPath, findMatchingPattern, concatHost, pushStateAndTrigger } from "./utils/fun.ts";

export { default as AdminLoader } from "./component/AdminLoader/index.tsx";
export { default as MarkEditor } from "./component/MarkEditor/index.tsx";
export { default as AdminModal } from "./component/AdminModal/index.tsx";
export { default as FormItems } from "./component/FormItems/index.tsx";
export { default as LoginForm } from "./component/LoginForm/index.tsx";
export { default as LeftNavMenu } from "./component/LeftNavMenu/index.tsx";
export { default as SearchForm } from "./component/searchForm/index.tsx";
export { default as TopNavigation } from "./component/TopNavigation/index.tsx";
export { default as AdminLayout } from "./component/AdminLayout/index.tsx";
export { default as HeaderLayout } from "./component/HeaderLayout/index.tsx";
export { default as HeaderLayoutLoader } from "./component/HeaderLayoutLoader/index.tsx";
export { default as ManagementList } from "./component/ManagementList/index.tsx";
export { default as InfiniteScroll } from "./component/InfiniteScroll/index.tsx";

export { AdminImage, ModalForm, DetailView, AdminTreeSelect, AdminSelect };

export { useConfig, ConfigProvider, Manager, MainLayout };

export { useApiRequest } from "./hook/useApiRequest.ts";
export { useLoadSysConfig } from "./hook/useLoadSysConfig.ts";
export { useCheckLogin } from "./hook/useCheckLogin.ts";
export { useAlwaysLogin } from "./hook/useAlwaysLogin.ts";
export { default as useLogout } from "./hook/useLogout.ts";
export { useHandleFormData } from "./hook/useHandleFormData.ts";
export { default as useBuildSearchFilters } from "./hook/useBuildSearchFilters.ts";
export { getSysConfigLabel };

export { default as useUploadOss } from "./hook/useUploadOss.ts";

export { datetimeFormat };

export { antd };
export { dayjs };
export { lodash };

export { type TableColumnConfig, type ManageApiConfig };

export { DesignConfigLayout, DesignLayout };

export { default as MarkPreview } from "./component/MarkPreview/index.tsx";

export {
  type ChartConfig,
  type AdminChartApiConfig,
  default as AdminChart,
} from "./component/AdminChart/index.tsx";

export {
  type ChartType,
  type D8dChartsApiConfig,
  type D8dChartsProps,
  D8dCharts,
} from "./component/AdminChart/D8dCharts.tsx"

export { default as RichEditor } from "./component/RichEditor/index.tsx";

export { default as PageTabs, type PageTabsRef } from "./component/PageTabs/index.tsx";

export type {
  ArticleData,
  UserData,
  ApiUrl,
  AppConfig,
  Theme,
  DetailFieldConfig,
  FormItemConfigs,
  FormItemType,
  Page,
  Pages,
  CommonNodes,
  PagesMap,
  CommonNodesMap,
  TSortOption,
  TFilterConditions,
  TPopulateOption,
  TPageRequest,
  FilterCriteria,
  EqualityFilter,
  MenuItem,
  RolePermission,
  LoginData,
  SysConfigItem,
  MenuItemType,
  SubMenuType
} from './global.ts';

// 只导出 mock 响应相关的类型
export type {
  MockResponse,
  MockResponseWithTotal,
} from './types/mock.ts';

export { default as FormUpload } from "./component/FormItems/FormUpload.tsx";
export { default as AdminUpload } from "./component/AdminUpload/index.tsx";
export type { FileInfo, AdminUploadProps } from './component/AdminUpload/index.tsx';
export type { RequestOptions } from "./hook/useApiRequest.ts";

export type { MainLayoutProps } from "./component/MainLayout/index.tsx";

export type { AuthMode } from "./component/AuthForm/index.tsx";
export type { AuthFormConfig } from "./pages/AdminPages/AuthPage.tsx";

export { useNavigate } from './hook/useNavigate.ts';
export { useParams } from './hook/useParams.ts';
export { useSearchParams } from './hook/useSearchParams.ts';
export { useLocation } from './hook/useLocation.ts';

// 导出路径匹配相关的工具函数
export { matchPath, extractParamsFromPath, findMatchingPattern, concatHost, pushStateAndTrigger };

export { default as AdminQueryClientProvider } from "./component/AdminQueryClientProvider/index.tsx";
export { default as AdminLink } from "./component/AdminLink/index.tsx";
export { default as MarkParse } from "./component/MarkPreview/index.tsx";